import random

def generate_data(num=3, max_n=5, max_coin=20, max_amount=100):
    """
    随机生成零钱兑换问题的数据
    :param num: 生成数据组数
    :param max_n: 每组硬币种类最大数
    :param max_coin: 硬币面额最大值
    :param max_amount: 金额最大值
    :return: (coins, amount) 列表
    """
    data = []
    for _ in range(num):
        n = random.randint(1, max_n)
        coins = random.sample(range(1, max_coin + 1), n)
        amount = random.randint(1, max_amount)
        data.append((coins, amount))
    return data

if __name__ == "__main__":
    for coins, amount in generate_data():
        print("硬币：", coins, "金额：", amount)
